package com.me.extend.view

import android.content.res.ColorStateList
import android.graphics.Bitmap
import android.graphics.PorterDuff
import android.graphics.drawable.Drawable
import android.widget.ImageView
import androidx.annotation.DrawableRes
import androidx.core.widget.ImageViewCompat
import kotlin.DeprecationLevel.HIDDEN

inline var ImageView.imageResource: Int
    @Deprecated(NO_GETTER, level = HIDDEN) get() = noGetter
    set(@DrawableRes value) = setImageResource(value)

inline var ImageView.imageDrawable: Drawable?
    get() = drawable
    set(value) = setImageDrawable(value)

inline var ImageView.imageBitmap: Bitmap
    @Deprecated(NO_GETTER, level = HIDDEN) get() = noGetter
    set(value) = setImageBitmap(value)

inline var ImageView.imgTintList: ColorStateList?
    get() = ImageViewCompat.getImageTintList(this)
    set(value) = ImageViewCompat.setImageTintList(this, value)

inline var ImageView.imgTintMode: PorterDuff.Mode?
    get() = ImageViewCompat.getImageTintMode(this)
    set(value) = ImageViewCompat.setImageTintMode(this, value)
